package com.ctshk.rpc.order.train.enums;

import com.ctshk.common.enums.SystemError;
import com.ctshk.common.exception.BusinessException;

public enum ActionEnum {

    /**
     * 请求来源 1 B端,2 C端
     */
    DEFAULT(1),

    PC(2),
    ;

    private final int actionType;

    ActionEnum(int actionType) {
        this.actionType = actionType;
    }

    public static ActionEnum getActionType(int actionType) {
        for (ActionEnum actionEnum : ActionEnum.values()) {
            if (actionType == actionEnum.actionType) {
                return actionEnum;
            }
        }
        throw new BusinessException(SystemError.SYS_433, "操作类型不合法");
    }

}
